package Day17;

import java.io.IOException;

public class Demo01 {
    public static void main(String[] args) throws IOException {
        //使用集合存储快递
        View v = new View();
        DoExpress d = new DoExpress();
        bb:while (true) {
            int a = v.xxx();
            aa:switch (a) {
                case 1: {
                    int b = v.courier();
                    switch (b) {
                        case 1: {//存快递
                            boolean b1 =d.add(v.add());
                            if(b1 == true){

                                System.out.println("添加成功");
                            }else{
                                System.out.println("添加失败");
                            }
                            break;
                        }
                        case 2: {//删除快递
                            boolean c = d.delete(v.delete());
                            if(c == true){
                                System.out.println("删除成功");
                            }else{
                                System.out.println("删除失败");
                            }
                            break;
                        }
                        case 3: {//修改快递
                            boolean r = d.revise(v.revise());
                            if(r == true){
                                System.out.println("修改成功");
                            }else{
                                System.out.println("修改失败");
                            }
                            break;
                        }
                        case 4: {//查看所有快递
                            d.printAll();
                            break;
                        }
                        case 0: {//退出
                            break aa;
                        }
                        default:
                            System.out.println("输入错误");
                    }
                    break;
                }
                case 2:{//用户  取快递
                    boolean b = d.user(v.user());
                    if(b == true){
                        System.out.println("取件成功");
                    }else{
                        System.out.println("取件失败");
                    }
                    break;
                }
                case 0:{
                    break bb;
                }
            }
        }
    }
}
